package com.sdweizan.sdk.bytedance.bean.settle;

import com.alibaba.fastjson.annotation.JSONField;
import com.sdweizan.sdk.bytedance.bean.BdBaseResponse;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

@NoArgsConstructor
@Data
public class BdQueryPlatformResponse extends BdBaseResponse {

  @JSONField(name = "platform_order")
  private PlatformOrder platformOrder;

  @NoArgsConstructor
  @Data
  public static class PlatformOrder {
    @JSONField(name = "app_id")
    private String appId;
    // 开发者侧支付订单号
    @JSONField(name = "out_order_no")
    private String outOrderNo;
    // 对应的查询类型
    @JSONField(name = "query_type")
    private String queryType;

    @JSONField(name = "settle_info_list")
    private List<SettleInfoList> settleInfoList;

    @NoArgsConstructor
    @Data
    public static class SettleInfoList {
      // 自动结算单号
      @JSONField(name = "out_settle_no")
      private String outSettleNo;
      // 小程序分账单号
      @JSONField(name = "settle_no")
      private String settleNo;
      // 分账状态枚举值：
      // SUCCESS：成功
      // FAIL：失败
      @JSONField(name = "settle_status")
      private String settleStatus;

      @JSONField(name = "created_at")
      // 结算单创建时间
      private String createdAt;

      @JSONField(name = "settled_at")
      // 结算完成时间
      private String settledAt;

      @JSONField(name = "settle_way")
      private String settleWay;
      // CPS佣金
      @JSONField(name = "cps")
      private Long cps;
      // 技术服务费
      @JSONField(name = "service_charge")
      private Long serviceCharge;

      @JSONField(name = "settle_param_list")
      private List<SettleParamList> settleParamList;

      @NoArgsConstructor
      @Data
      public static class SettleParamList {
        // 分账金额
        @JSONField(name = "amount")
        private Long amount;
        // 分账方商户号
        @JSONField(name = "merchant_uid")
        private String merchantUid;
      }
    }
  }
}
